//
//  AboutOurViewController.m
//  DongChiDaChiProject1
//
//  Created by lanou3g on 15/10/28.
//  Copyright © 2015年 com.lanou3g. All rights reserved.
//)

#import "AboutOurViewController.h"
#import "AboutOurTwoViewController.h"
#import "UIViewController+PortalTransition.h"
#import "CYViewControllerTransitioningDelegate.h"

@interface AboutOurViewController ()

@property (nonatomic, strong) CYViewControllerTransitioningDelegate *viewControllerTransitionDelegate;

@end

@implementation AboutOurViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = self.titleName;
   // self.view.backgroundColor = [UIColor purpleColor];
     self.view.backgroundColor = [UIColor whiteColor];
    UIImageView *image = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    image.backgroundColor = [UIColor yellowColor];
    image.image = [UIImage imageNamed:@"guanyuwomen1.jpg"];
    [self.view addSubview:image];
    
    
    
    [self addBar];
    
    [self addView];
    
}

// 添加视图
- (void)addView
{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        AboutOurTwoViewController *secondVC = [AboutOurTwoViewController new];
        secondVC.delegate = self;
        secondVC.modalPresentationStyle = UIModalPresentationCustom;
        UINavigationController *navc = [[UINavigationController alloc] initWithRootViewController:secondVC];
        //[self presentViewController:secondVC animated:YES completion:nil];
        [self presentPortalTransitionViewController:navc completion:nil];
    });
}

#pragma mark - 添加bar
- (void)addBar
{
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithTitle:@"我的" style:UIBarButtonItemStylePlain target:self action:@selector(returnToLast:)];
    leftItem.tintColor = [UIColor colorWithHue:0.8 saturation:1 brightness:0.7 alpha:1];
    self.navigationItem.leftBarButtonItem = leftItem;
    
    [self.navigationController.navigationBar setTranslucent:NO];
}

- (void)returnToLast:(UIBarButtonItem *)barItem
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - 代理方法
- (void)removePop
{
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
